<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5" style="background-color: #2272eb" onclick="print_flow_dan()">打印审批单</button>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div class="tongbox tongbox6">
            <div class="tuo">
                <div class="tit">项目名称</div>
                <div class="con colorlan" id="tong_enginname"></div>
            </div>
            <div class="tuo">
                <div class="tit">供应商（付款对象）</div>
                <div class="con colorlan" id="tong_yijuid_gonger"></div>
            </div>
            <div class="tuo">
                <div class="tit">款项类型</div>
                <div class="con" id="tong_budid_name"></div>
            </div>
            <div class="tuo">
                <div class="tit">请款金额(元)</div>
                <div class="con" id="tong_money"></div>
            </div>
            <div class="tuo">
                <div class="tit">付款依据</div>
                <div class="con colorlan" id="tong_yiju_name"></div>
            </div>

            <div class="tuo">
                <div class="tit">已支付(元)</div>
                <div class="con colorlan" id="tong_accmoney"></div>
            </div>
        </div>

        <div><?php include "../public_flow/flow_show_info.php";?></div>

        <div class="table-box tablenes">
            <div class="title">基本信息</div>
            <table class="layui-table">
                <tbody>

                <tr><td class="tt">付款编号</td><td id="number" colspan="3" class="tv"></td></tr>
                <tr><td class="tt">项目名称</td><td id="enginname" class="colorlan tv"></td><td class="tt">款项类型</td><td id="budid_name" class="tv"></td></tr>
                <tr class="noneyiju"><td class="tt">款项摘要</td><td id="zhai" class="tv"></td><td class="tt">付款依据</td><td id="yiju_name" class="tv"></td></tr>
                <tr class="noneyiju2"><td class="tt">依据(名称)</td><td id="yijuid_name" class="colorlan tv"></td><td class="tt">依据(供应方)</td><td id="yijuid_gonger" class="tv"></td></tr>
                <tr><td class="tt">请款金额(元)</td><td id="money" class="tv"></td><td class="tt">发票情况</td><td id="incqing" class="tv"></td></tr>
                <tr><td class="tt">支付方式</td><td id="incdaotype" class="tv"></td><td class="tt">付款对象</td><td id="gonger" class="tv"></td></tr>
                <tr><td class="tt">账户账号</td><td id="banknum" class="tv"></td><td class="tt">开户行</td><td id="bankname" class="tv"></td></tr>

                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>



        <div class="table-box tablenes">
            <div class="title">支付信息(出纳)</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">支付状态</td><td id="payfo_status" class="tv"></td><td class="tt">最近支付日期</td><td id="payfo_dt" class="tv"></td></tr>
                <tr><td class="tt">已支付金额(元)</td><td id="payfo_payfee" class="tv"></td><td class="tt">未支付金额</td><td id="payfo_dai" class="tv"></td></tr>
                </tbody>
            </table>
        </div>

        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_payment_engin_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var engininfo = res.data.engininfo;
                var yujuinfo = res.data.yujuinfo;




                $("#enginname").text(engininfo.name).click(function () {
                    openPage('../engin/show.php?id='+engininfo.id);
                });


                $("#tong_enginname").text(engininfo.name).click(function () {
                    openPage('../engin/show.php?id='+engininfo.id);
                });
                $("#tong_yijuid_gonger").html(data.gonger || '').click(function () {
                    if(data.gonger){
                        openPage('../tong_gong_gong/tong.php?gonger='+encodeURI(data.gonger), '80%', '80%');
                    }
                });
                $("#tong_budid_name").text(data.budid_name);
                $("#tong_money").text(parseFormatNum(data.money));
                if(data.yiju != 'none'){
                    $("#tong_yiju_name").text(yujuinfo.stname+yujuinfo.number+'(金额：'+yujuinfo.money+')').click(function () {
                        if(data.yiju == 'concaistuff'){
                            openPage('../contract_cai/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'stuffcai'){
                            openPage('../stuff_cai/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'stuffru'){
                            openPage('../stuff_ru/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'stuffjie'){
                            openPage('../stuff_jie/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'concailabour'){
                            openPage('../contract_cai/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'labourshen'){
                            openPage('../labour_shen/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'labourling'){
                            openPage('../labour_ling/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'concaidevice'){
                            openPage('../contract_cai/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'devicejie'){
                            openPage('../device_jie/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'devicelin'){
                            openPage('../device_lin/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'concaisubbao'){
                            openPage('../contract_cai/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'subbaoshen'){
                            openPage('../subbao_shen/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'concaiqi'){
                            openPage('../contract_cai/show.php?id='+yujuinfo.id);
                        }
                    });
                }else{
                    $("#tong_yiju_name").html('<span class="colorhui">无</span>')
                }
                $("#tong_accmoney").text(parseFormatNum(data.accmoney)).click(function () {
                    openPage('../account_zhi/tong.php?type=3&mid='+data.id, '80%', '80%');
                });




                $("#number").text(data.number);
                $("#budid_name").text(data.budid_name);
                $("#zhai").text(data.zhai);
                $("#zhai2").text(data.zhai);
                $("#money").text(showChineseNumber(data.money));
                $("#incqing").text(data.incqing);
                $("#incdaotype").text(data.incdaotype);
                $("#gonger").text(data.gonger);
                $("#banknum").text(data.banknum);
                $("#bankname").text(data.bankname);
                $("#explain").text(data.explain);


                $("#payfo_status").text(data.payfo_status);
                $("#payfo_payfee").text(data.payfo_payfee);
                $("#payfo_dt").text(data.payfo_dt);
                $("#payfo_dai").text(data.payfo_dai);





                if(data.yiju != 'none'){
                    $("#yiju_name").text(yujuinfo.stname || '无');
                    $("#yijuid_name").text(yujuinfo.stname+yujuinfo.number+'(金额：'+yujuinfo.money+')').click(function () {
                        if(data.yiju == 'concaistuff'){
                            openPage('../contract_cai/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'stuffcai'){
                            openPage('../stuff_cai/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'stuffru'){
                            openPage('../stuff_ru/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'stuffjie'){
                            openPage('../stuff_jie/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'concailabour'){
                            openPage('../contract_cai/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'labourshen'){
                            openPage('../labour_shen/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'labourling'){
                            openPage('../labour_ling/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'concaidevice'){
                            openPage('../contract_cai/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'devicejie'){
                            openPage('../device_jie/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'devicelin'){
                            openPage('../device_lin/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'concaisubbao'){
                            openPage('../contract_cai/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'subbaoshen'){
                            openPage('../subbao_shen/show.php?id='+yujuinfo.id);
                        }else if(data.yiju == 'concaiqi'){
                            openPage('../contract_cai/show.php?id='+yujuinfo.id);
                        }
                    });

                    $("#yijuid_gonger").text(yujuinfo.gonger);
                }else{
                    $(".noneyiju2").remove();
                    $("#yiju_name").text('无');
                }


                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('payment_engin', param_id);
    });


    function print_flow_dan() {
        openNavPage('项目付款（供应商）打印','payment_engin/print.php?id='+param_id)
    }
</script>
</body>
</html>




